<template>
  <div>
    <!-- 软磁 ！！！此页面全部都是陈军学长编写，有bug请联系陈军学长-->
    <!-- 样本基本参数卡片视图区域 -->
    <el-card class="box-card">
      <el-row :gutter="20" style="margin-bottom:20px;">
        <el-col :span="1.5" style="margin-top: 4px">
          <advancedSearch ref="advancedSearch" @getRef="getTableRef" @getInquiryResult="getTableInquiryResult" @resetQuery="resetQuery"></advancedSearch>
        </el-col>
        <el-col :span="1.5" style="margin-top: 4px">
          <el-button type="primary" size="mini" @click="isCheck">批量编辑</el-button>
        </el-col>
        <el-col v-if="checkSelection.length > 0" :span="1.5" style="margin-top: 4px">
          <el-button type="primary" size="mini" @click="cancelCheck" plain>取消勾选</el-button>
        </el-col>
      </el-row>
      <el-tabs type="border-card" @tab-click="tabClick">
        <el-tab-pane label="软磁性能">
          <el-table
            ref="ruanCiTable"
            v-loading="loading"
            element-loading-text="拼命加载中"
            @sort-change="tableGetSortChange"
            :default-sort="sortRule"
            :data="parameterList"
            height="700px"
            style="margin: 10px 0 10px; overflow-y: auto;"
            @selection-change="parameterSelect"
            border
            :header-cell-style="{ background: '#FAFAFA' }"
            :row-key="getRowKeys"
          >
            <el-table-column label-class-name="DisabledSelection" type="selection" fixed="left" width="40" :reserve-selection="true"> </el-table-column>
            <el-table-column align="center" label="编号" prop="parameterId" width="70px"></el-table-column>
            <el-table-column align="center" label="牌号" prop="grade" width="120px"></el-table-column>
            <el-table-column align="center" label="样品规格" prop="specification" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="国别" prop="country"></el-table-column>
            <el-table-column align="center" label="生产商" prop="manufacturer" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="执行标准" prop="standard" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="标称密度/(kg/m³)" width="180px" prop="nominalDensity" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="单片厚度/mm" width="140px" prop="thickness" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="标称叠压系数" width="160px" prop="overlapCoefficient" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="饱和磁密/T" width="130px" prop="fluxDensity" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="饱和磁致伸缩系数/ppm" width="210px" prop="magCoefficient" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="电导率/(S/m)" width="140px" prop="electricalConductivity" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="热导率/(W/m-k)" width="160px" prop="heatConductivity" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="屈服强度/MPa" width="150px" prop="yieldStrength" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="居里温度/Cel.Deg" width="170px" prop="curieTemperature" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="入库日期" width="120px" prop="inDate" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="样品柜编号" width="100px" prop="cabinetNumber" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="项目组" prop="projuctGroup" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="样品提供人" width="100px" prop="sampleProducer" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="备注" prop="remarks" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="操作" fixed="right" width="80px">
              <template slot-scope="scope">
                <el-button type="text" @click.native.stop="deleteData(scope.row)" size="mini">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
          <!-- 分页区 -->
          <!-- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="queryInfo.pageNum" :page-sizes="[10, 20]" :page-size="queryInfo.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> -->
        </el-tab-pane>
        <el-tab-pane label="永磁性能">
          <el-table
            ref="yongCiTable"
            v-loading="loading"
            element-loading-text="拼命加载中"
            @sort-change="tableGetSortChange"
            :default-sort="sortRule"
            :data="parameterList1"
            height="700px"
            style="margin: 10px 0 10px; overflow-y: auto;"
            @selection-change="parameterSelect"
            border
            :header-cell-style="{ background: '#FAFAFA' }"
            :row-key="getRowKeys"
          >
            <el-table-column label-class-name="DisabledSelection" type="selection" fixed="left" width="40"> </el-table-column>
            <el-table-column align="center" label="编号" prop="parameterId" width="70px"></el-table-column>
            <el-table-column align="center" label="牌号" prop="grade" width="120px"></el-table-column>
            <el-table-column align="center" label="国别" prop="country"></el-table-column>
            <el-table-column align="center" label="生产商" prop="manufacturer" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="执行标准" prop="standard" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="标称密度/(kg/m³)" width="170px" prop="nominalDensity" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="材料类型" width="90px" prop="materialsType" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="生产工艺" width="90px" prop="manufacturingTechnique" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="样品规格" width="90px" prop="specification" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="剩磁Br/T" width="120px" prop="remanence" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="矫顽力Hcb/(kA/m)" width="180px" prop="coercivity" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="内禀矫顽力Hcj/(kA/m)" width="200px" prop="intrinsicCoercivity" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="最大磁能积/(kJ/m^3)" width="170px" prop="maximumMagnetic" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="电导率/(S/m)" width="140px" prop="specificConductance" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="回复磁导率" width="140px" prop="recoilPermeability" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="热导率/(W/m.K)" width="170px" prop="heatConductivity" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="杨氏模量/GPa" width="140px" prop="youngModulus" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="韦氏硬度" width="120px" prop="hw" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="Br可逆温度系数/(%/^。C)" width="220px" prop="brReversibleTemperature" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="Hcj可逆温度系数/(%/^。C)" width="230px" prop="hcjReversibleTemperature" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="居里温度/^。C" width="140px" prop="curiePoint" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="最高工作温度/^。C" width="180px" prop="maximumTemperature" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="入库日期" width="120px" prop="inDate" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="样品柜编号" width="100px" prop="cabinetNumber" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="项目组" prop="projuctGroup" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="样品提供人" width="100px" prop="sampleProducer" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="备注" prop="remarks" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="操作" fixed="right" width="80px">
            <template slot-scope="scope">
                <el-button type="text" @click.native.stop="deleteData(scope.row)" size="mini">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
          <!-- 分页区 -->
          <!-- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="queryInfo.pageNum" :page-sizes="[10, 20]" :page-size="queryInfo.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> -->
        </el-tab-pane>
        <el-tab-pane label="导电性能">
          <el-table
            ref="daoDianTable"
            v-loading="loading"
            element-loading-text="拼命加载中"
            @sort-change="tableGetSortChange"
            :default-sort="sortRule"
            :data="parameterList2"
            height="700px"
            style="margin: 10px 0 10px; overflow-y: auto;"
            @selection-change="parameterSelect"
            border
            :header-cell-style="{ background: '#FAFAFA' }"
            :row-key="getRowKeys"
          >
            <el-table-column label-class-name="DisabledSelection" type="selection" fixed="left" width="40"> </el-table-column>
            <el-table-column align="center" label="编号" prop="parameterId" width="70px"></el-table-column>
            <el-table-column align="center" label="牌号" prop="grade" width="120px"></el-table-column>
            <el-table-column align="center" label="国别" prop="country"></el-table-column>
            <el-table-column align="center" label="生产商" prop="manufacturer" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="执行标准" prop="standard" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="标称密度/(kg/m³)" width="170px" prop="nominalDensity" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="样品规格" prop="specification" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="电导率/(S/m)" width="150px" prop="specificConductance" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="热导率/(W/m.K)" width="170px" prop="heatConductivity" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="屈服强度/MPa" width="150px" prop="yieldStrength" show-overflow-tooltip></el-table-column>
            <el-table-column sortable="custom" align="center" label="入库日期" width="120px" prop="inDate" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="样品柜编号" width="100px" prop="cabinetNumber" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="项目组" prop="projuctGroup" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="样品提供人" width="100px" prop="sampleProducer" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="备注" prop="remarks" show-overflow-tooltip></el-table-column>
            <el-table-column align="center" label="操作" fixed="right" width="80px">
            <template slot-scope="scope">
                <el-button type="text" @click.native.stop="deleteData(scope.row)" size="mini">删除</el-button>
              </template>
            </el-table-column>
          </el-table>
          <!-- 分页区 -->
          <!-- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="queryInfo.pageNum" :page-sizes="[10, 20]" :page-size="queryInfo.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination> -->
        </el-tab-pane>
      </el-tabs>

      <el-dialog title="批量编辑弹窗" :visible.sync="mainLibraryDialog" width="20%">
        <el-row :gutter="20" style="margin-bottom: 10px">
          <el-col>
            编辑字段：<el-select v-model="editParam.property" placeholder="请选择编辑字段">
              <el-option v-for="item in mainLibraryOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option>
            </el-select>
          </el-col>
        </el-row>
        <el-row :gutter="20" style="margin-bottom: 10px">
          <el-col> 修改内容：<el-input v-model="editParam.content" style="width:215px;"></el-input> </el-col>
        </el-row>

        <span slot="footer" class="dialog-footer">
          <el-button type="primary" size="small" style="margin-right: 20px" @click="confirmEdit">确定</el-button>
          <el-button type="danger" size="small" style="margin-right: 20px" @click="mainLibraryDialog = false">关闭</el-button>
        </span>
      </el-dialog>

      <!-- 删除弹框 -->
      <el-dialog title="确认删除" :visible.sync="outerVisible">
        <el-dialog width="30%" title="删除数据确认" :visible.sync="innerVisible" append-to-body>
          <el-input v-model="deleteId" placeholder="请输入编号"></el-input>
          <div slot="footer" class="dialog-footer">
            <el-button @click="deleteCancel">取消</el-button>
            <el-button type="primary" @click="deleteConfirm">确认</el-button>
          </div>
        </el-dialog>
        <div slot="footer" class="dialog-footer">
          <el-button @click="outerVisible = false">取消</el-button>
          <el-button type="primary" @click="innerVisible = true">确认删除</el-button>
        </div>
      </el-dialog>
    </el-card>
  </div>
</template>

<script>
import { Message } from 'element-ui'
import advancedSearch from '../query/components/advancedSearch.vue'
import fastSearch from '../query/components/fastSearch.vue'
import { axios } from '../fileCheck/axios.mini'
export default {
  components: {
    advancedSearch,
    fastSearch
  },
  data() {
    return {
      importDataType: '软磁性能', //传入子组件进行判断
      options: [
        {
          value: '软磁性能',
          label: '软磁性能'
        },
        {
          value: '永磁性能',
          label: '永磁性能'
        },
        {
          value: '导电性能',
          label: '导电性能'
        }
      ],
      sortRule: { prop: null, order: null },
      total: 0,
      parameterList: [],
      parameterList1: [],
      parameterList2: [],
      sort: '/null',
      //分页
      queryInfo: {
        //当前的页数
        pageNum: 1,
        //当前每页显示多少条数据
        pageSize: 20,
        userId: JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id
      },
      primaryTableSort: {
        content: 'parameterId',
        sortOrder: 'ASC'
      },
      queryNum: 1,
      advancedSearchData: {
        queryArray: [],
        andOr: ''
      },
      fastSearchData: {
        content: ''
      },
      loading: false,
      checkSelection: [],
      mainLibraryDialog: false,
      mainLibraryOptions: [],
      editParam: {
        idList: [],
        property: '',
        content: '',
        type: ''
      },
      outerVisible: false,
      innerVisible: false,
      deleteRow: {},
      deleteId: ''
    }
  },

  created() {
    this.loadData()
  },

  mounted() {
    this.lazyLoading();
  },

  methods: {
    confirmEdit() {
      this.editParam.idList = []
      for (let i = 0; i < this.checkSelection.length; i++) {
        this.editParam.idList.push(this.checkSelection[i].id)
      }
      this.axios({
        baseURL: 'http://59.172.104.174:30669',
        url: '/bulkEditing/editParameter',
        method: 'POST',
        data: this.editParam
      }).then(res => {
        console.log('rescheck', res)
        if (res.data.code == 200) {
          Message({
            message: '批量编辑成功！',
            type: 'success',
            center: true,
            customClass: 'mzindex'
          })
          this.loadData()
          this.mainLibraryDialog = false
        } else {
          Message({
            message: '批量编辑失败！',
            type: 'error',
            center: true,
            customClass: 'mzindex'
          })
        }
      })
    },
    isCheck() {
      this.mainLibraryOptions = []
      if (this.checkSelection.length == 0) {
        Message({
          message: '请先勾选需要批量编辑的数据！',
          type: 'warning',
          center: true,
          customClass: 'mzindex'
        })
      } else {
        this.mainLibraryDialog = true
        if (this.importDataType == '软磁性能') {
          let columnTitle = this.$refs.ruanCiTable.$children
            .filter(x => {
              return x._props.prop !== undefined
            })
            .map(x => {
              return new Object({
                value: x._props.prop,
                label: x._props.label
              })
            })
          this.mainLibraryOptions = columnTitle
          this.editParam.type = '软磁样品基本参数'
        } else if (this.importDataType == '永磁性能') {
          let columnTitle = this.$refs.yongCiTable.$children
            .filter(x => {
              return x._props.prop !== undefined
            })
            .map(x => {
              return new Object({
                value: x._props.prop,
                label: x._props.label
              })
            })
          this.mainLibraryOptions = columnTitle
          this.editParam.type = '永磁样品基本参数'
        } else if (this.importDataType == '导电性能') {
          let columnTitle = this.$refs.daoDianTable.$children
            .filter(x => {
              return x._props.prop !== undefined
            })
            .map(x => {
              return new Object({
                value: x._props.prop,
                label: x._props.label
              })
            })
          this.mainLibraryOptions = columnTitle
          this.editParam.type = '导电样品基本参数'
        }
      }
    },
    cancelCheck() {
      if (this.importDataType == '软磁性能') {
        this.$refs.ruanCiTable.clearSelection()
      } else if (this.importDataType == '永磁性能') {
        this.$refs.yongCiTable.clearSelection()
      } else if (this.importDataType == '导电性能') {
        this.$refs.daoDianTable.clearSelection()
      }
      this.checkSelection = []
      Message({
        message: '取消勾选成功！',
        type: 'success',
        center: true,
        customClass: 'mzindex'
      })
    },
    tabClick(e) {
      this.parameterList = []
      this.parameterList1 = []
      this.parameterList2 = []
      this.checkSelection = []
      this.queryInfo.pageSize = 20
      if (e.label == '软磁性能') {
        this.importDataType = e.label
        this.loadData()
      } else if (e.label == '永磁性能') {
        this.importDataType = e.label
        this.loadData()
      } else if (e.label == '导电性能') {
        this.importDataType = e.label
        this.loadData()
      }
    },
    tableGetSortChange(column) {
      if (column.order == 'ascending') {
        this.primaryTableSort.content = column.prop
        this.primaryTableSort.sortOrder = 'ASC'
      } else if (column.order == 'descending') {
        this.primaryTableSort.content = column.prop
        this.primaryTableSort.sortOrder = 'DASC'
      } else if (column.order == null) {
        this.primaryTableSort.content = 'parameterId'
        this.primaryTableSort.sortOrder = 'ASC'
      }
      this.loadData()
    },
    deleteCancel() {
      this.innerVisible = false
      this.outerVisible = false
    },
    deleteData(row) {
      this.deleteId = ''
      console.log(row)
      this.deleteRow = row
      this.outerVisible = true
    },
    deleteConfirm() {
      let type = this.deleteRow.dataType.slice(0, 2) + '样品基本参数'
      if (this.deleteId == this.deleteRow.parameterId) {
        this.axios({
          baseURL: 'http://59.172.104.174:30669',
          url: '/admin/deleteData',
          method: 'POST',
          data: {
            id: this.deleteRow.id, // 样品基本参数id
            type: type, // “软磁样品基本参数”
            message: '' // 不给 为空就行
          }
        }).then(res => {
          if (res.data.result.code == 200) {
            Message({
              message: res.data.result.message,
              type: 'success',
              center: true,
              customClass: 'mzindex'
            })
            this.approveVisible = false
            this.loadData()
          }
        })
        this.innerVisible = false
        this.outerVisible = false
      } else {
        Message({
          message: '编号核对错误！',
          type: 'warning',
          customClass: 'mzindex'
        })
      }
      // this.innerVisible = false
    },

    /*************** 快速查询相关函数  *********************/
    resetQueryKs() {
      this.queryInfo.pageNum = 1
      // this.queryInfo.pageSize = 10
      this.queryNum = 1
      this.loadData()
    },

    getTableFastResult(content) {
      this.queryNum = 3
      this.fastSearchData.content = content
      this.queryInfo.pageNum = 1
      // this.queryInfo.pageSize = 10
      this.loadData()
    },
    /*************** 快速查询相关函数  *********************/

    /*************** 高级查询相关函数  *********************/
    resetQuery() {
      this.queryInfo.pageNum = 1
      // this.queryInfo.pageSize = 10
      this.queryNum = 1
      this.loadData()
    },
    //获取高级查询组件查询结果
    getTableInquiryResult(queryArray, andOr) {
      this.queryNum = 2
      this.advancedSearchData.queryArray = queryArray
      this.advancedSearchData.andOr = andOr
      this.queryInfo.pageNum = 1
      // this.queryInfo.pageSize = 10
      this.loadData()
    },
    //获取主表的ref信息
    getTableRef() {
      if (this.importDataType == '软磁性能') {
        console.log('软磁性能')
        this.$refs.advancedSearch.getTableColumn(this.$refs.ruanCiTable)
      } else if (this.importDataType == '永磁性能') {
        console.log('永磁性能')
        this.$refs.advancedSearch.getTableColumn(this.$refs.yongCiTable)
      } else if (this.importDataType == '导电性能') {
        this.$refs.advancedSearch.getTableColumn(this.$refs.daoDianTable)
      }
    },
    /*************** 高级查询相关函数  *********************/
    parameterSelect(selection) {
      console.log('selection', selection)
      this.checkSelection = selection
    },

    loadData() {
      var obj = {
        superPageVo: {
          pageNum: this.queryInfo.pageNum,
          pageSize: this.queryInfo.pageSize,
          userId: JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id
        },
        advancedVo: {
          pageNum: this.queryInfo.pageNum,
          pageSize: this.queryInfo.pageSize,
          queryArray: this.advancedSearchData.queryArray,
          type: '',
          andOr: this.advancedSearchData.andOr,
          userId: JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id
        },
        searchPageVo: {
          pageNum: this.queryInfo.pageNum,
          pageSize: this.queryInfo.pageSize,
          content: this.fastSearchData.content,
          userId: JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id
        },
        num: this.queryNum,
        content: this.primaryTableSort.content,
        sortOrder: this.primaryTableSort.sortOrder
      }
      this.loading = true
      if (this.importDataType == '软磁性能') {
        this.axios({
          baseURL: 'http://59.172.104.174:30669',
          url: `/productParameter/selectParameter${this.sort}`,
          method: 'POST',
          data: obj
        }).then(res => {
          this.parameterList = res.data.result.records
          this.total = res.data.result.total
          this.loading = false
          this.$forceUpdate();
        })
      } else if (this.importDataType == '永磁性能') {
        this.axios({
          baseURL: 'http://59.172.104.174:30669',
          url: `/perMagnetParameter/selectParameter${this.sort}`,
          method: 'POST',
          data: obj
        }).then(res => {
          this.parameterList1 = res.data.result.records
          this.total = res.data.result.total
          this.loading = false
          this.$forceUpdate();
        })
      } else if (this.importDataType == '导电性能') {
        this.axios({
          baseURL: 'http://59.172.104.174:30669',
          url: `/eleParameter/selectParameter${this.sort}`,
          method: 'POST',
          data: obj
        }).then(res => {
          this.parameterList2 = res.data.result.records
          this.total = res.data.result.total
          this.loading = false
          this.$forceUpdate();
        })
      }
    },

    /*************** 分页  *********************/
    //页码改变
    handleSizeChange(newSize) {
      this.queryInfo.pageSize = newSize
      this.loadData()
    },
    handleCurrentChange(newPage) {
      this.queryInfo.pageNum = newPage
      this.loadData()
    },
    getRowKeys(row){
      return row.parameterId // 设定每一条对应一个key
    },
    lazyLoading() {
      // console.log('this.importDataType', this.importDataType)
      // if (this.importDataType == '软磁性能') {
      //   let table = this.$refs.ruanCiTable.$el;
      // } else if (this.importDataType == '永磁性能') {
      //   let table = this.$refs.yongCiTable.$el;
      // } else if (this.importDataType == '导电性能') {
      //   let table = this.$refs.daoDianTable.$el;
      // }
      let table = []
      let dom = []
      table[0] = this.$refs.ruanCiTable.$el;
      table[1] = this.$refs.yongCiTable.$el;
      table[2] = this.$refs.daoDianTable.$el;
      for (let i = 0; i < table.length; i++) {
        dom[i] = table[i].querySelector('.el-table__body-wrapper');
        this.$nextTick(() => {
          dom[i].addEventListener("scroll", (v) => {
            const scrollDistance = dom[i].scrollHeight - Math.round(dom[i].scrollTop) - dom[i].clientHeight;
            // console.log("鼠标滑动-scrollDistance",scrollDistance)
            // if (scrollDistance <= 0) {  //分辨率问题，如果设置 100% ，滑倒最底部，scrollDistance的值 可能为 0.201 到 -0.201
            if (scrollDistance == 0) {
                //等于0证明已经到底，可以请求接口
                console.log('this.queryInfo', this.queryInfo)
                this.queryInfo.pageSize = this.queryInfo.pageSize + 10
                this.handleSizeChange(this.queryInfo.pageSize)
            }
          });
        })
      }
    },
    /*************** 分页  *********************/
  }
}
</script>

<style scoped>
.box {
  margin-top: 10px;
  display: flex;
  /* justify-content: space-between; */
}
.el-divider--horizontal {
  font-weight: 100;
  display: block;
  height: 1px;
  width: 100%;
  margin: 10px 0;
}
.mzindex {
  z-index: 3000 !important;
}

/*去除顶部标头的选择框*/
/* .el-table >>> .DisabledSelection .cell .el-checkbox__inner {
  display: none;
  position: relative;
} */

/*修改el-table中排序小三角样式*/
::v-deep .el-table .caret-wrapper {
  height: 45px;
}
::v-deep .el-table .sort-caret {
  border: 7px solid transparent;
}
::v-deep .el-table .sort-caret.ascending {
  border-bottom-color: #c0c4cc;
  top: 5px;
}
::v-deep .el-table .sort-caret.descending {
  border-top-color: #c0c4cc;
  bottom: 7px;
}
::v-deep .descending .sort-caret.descending {
  border-top-color: #4e9efd;
}
::v-deep .ascending .sort-caret.ascending {
  border-bottom-color: #4e9efd;
}
</style>
